package pers.test.votemanage.controller;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import pers.test.votemanage.controller.response.CommResponse;
import pers.test.votemanage.domain.User;
import pers.test.votemanage.service.UserService;

@RestController
@Api(tags = "用户控制层")
public class UserController {

    @Autowired
    private UserService userService;

    @PostMapping("/register")
    @ApiOperation(value = "用户注册",notes = "用户注册")
    public CommResponse register(@RequestBody User user){
        userService.register(user);
        return CommResponse.success();
    }
}
